﻿using System;
using System.Collections.Generic;
using System.Text;
using SharpMap.Forms;
using System.Windows.Forms;
using System.Drawing;

namespace RSIS.File
{
    public class ExportMapCmd : SharpMap.Utilities.BaseCommand
    {
        private  SharpMap.Forms.MapImage m_pMapImage;
        
        public ExportMapCmd()
        {
            base.m_caption = "导出地图";
            //base.m_category = "RSISFile";
           // base.m_message = "导出地图";
            base.m_name = "ExportMapCmd";
            base.m_toolTip = "导出地图";
        }

        public override void OnClick()
        {
            base.OnClick();
            System.Windows.Forms.SaveFileDialog sfdMap = new SaveFileDialog();
            sfdMap.Filter = "图片文件(*.jpg)|*.jpg";
            if (sfdMap.ShowDialog() == DialogResult.OK)
            {
                m_pMapImage.Image.Save(sfdMap.FileName);
                MessageBox.Show("导出完成!");

            }
        }

        public override void OnCreate(object hook)
        {
            m_pMapImage = (SharpMap.Forms.MapImage)hook;
        }





    }
}
